view.initItemEditFrame = function(iframe) {
	view.subWin = iframe.get("iFrameWindow");
}
view.save = function() {
	if(view.subWin) {
		view.get("#updateAction1").execute(function() {
			var item = view.get("#dsItem.data:#");
			view.subWin.save(item.get("id"));
		});
	} else {
		dorado.MessageBox.alert("请选择有效的事项并填写相关内容！");
	}
}
view.hideDialog = function() {
	var state, dirty = false;
	if(view.subWin) {
		state = view.subWin.getState();
		if(state != dorado.Entity.STATE_NONE) {
			dirty = true;
		}
	} else {
		state = view.get("#dsItem.data:#");
		if(state != dorado.Entity.STATE_NONE) {
			dirty = true;
		}
	}
	if(dirty) {
		dorado.MessageBox.confirm("数据尚未保存，确定要取消吗？", function() {
			view.get("#dialog1").hide();
			view.get("#dsItem").flushAsync();
		});
	}
}
view.startProcess = function() {
	var state, dirty = false;
	if(view.subWin) {
		state = view.subWin.getState();
		if(state != dorado.Entity.STATE_NONE) {
			dirty = true;
		}
		var entity = view.get("#dsItem.data:#")
		state = entity.getState();
		if(state != dorado.Entity.STATE_NONE) {
			dirty = true;
		}
		if(dirty) {
			dorado.MessageBox.alert("请先保存数据！");
		} else {
			if(entity.get("withinDept")) {
				view.get("#dialog1").show();
			} else {
				view.doStartProcess();
			}
			view.get("#dialog1").show();
		}
	} else {
		dorado.MessageBox.alert("请选择有效的事项并填写相关内容！");
	}
}
view.doStartProcess = function() {
	var beanId = !view.subWin.getInterceptor ? null : view.subWin.getInterceptor();
	var entity = view.get("#dsItem.data:#");
	view.get("startProcessAction").set("parameter", {
		itemApprovalId: entity.get("id"),
		beanId: beanId,
		shenhekz:
	}).execute();
}